using Framework.UI;
using Framework.Network;
using Framework;
using UnityEngine.UI;
using UnityEngine;

namespace Game
{
    public class LoginPanel : UIPanel
    {
        public InputField m_AccountInput;

        private void Awake()
        {
            string account = PlayerPrefs.GetString("Account", "");
            this.m_AccountInput.text = account;
        }

        public void OnClickEnterBtn()
        {
            string account = this.m_AccountInput.text;
            if (account == "" || account == null)
            {
                return;
            }

            Log.Info($"[Login]{account}进行登录");
            
            LoginUtility.LoginAsync(account, "111").Coroutine();

            PlayerPrefs.SetString("Account", account);
        }
    }
}